
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/14_Table_A10.do" 

. /*
> Replication files for "Housing Discrimination and the Pollution Exposure Gap 
> in the United States" 
> */
. 
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. keep if sample==1
(801 observations deleted)

. 
. loc quartiles 4

. 
. 
. set seed 1010101

. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. 
. 
. 
. clogit choice Minority_dec2 Minority_dec3 Minority_dec4 i.gender i.education_
> level i.order, group(Address)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -925.74055  
Iteration 1:   log likelihood = -916.48806  
Iteration 2:   log likelihood = -916.46513  
Iteration 3:   log likelihood = -916.46513  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                LR chi2(8)        =     166.54
                                                Prob > chi2       =     0.0000
Log likelihood = -916.46513                     Pseudo R2         =     0.0833

------------------------------------------------------------------------------
      choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.5211012   .1511304    -3.45   0.001    -.8173114   -.2248911
Minority_d~3 |  -.3482699   .1045956    -3.33   0.001    -.5532736   -.1432663
Minority_d~4 |   .1434486    .146184     0.98   0.326    -.1430667     .429964
             |
      gender |
       male  |  -.3129561   .0849186    -3.69   0.000    -.4793934   -.1465188
             |
education_~l |
        low  |  -.1674876   .1154418    -1.45   0.147    -.3937495    .0587742
     medium  |  -.2999306   .0980768    -3.06   0.002    -.4921577   -.1077035
             |
       order |
          2  |  -.3356589   .0846338    -3.97   0.000     -.501538   -.1697798
          3  |  -.9002829   .0862373   -10.44   0.000    -1.069305    -.731261
------------------------------------------------------------------------------

. predict phat, pu0

. 
. sum phat if Minority==1 & dec2==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      1,200    .2291603    .0710336   .1156514   .3725948

. loc p12 `r(mean)'

. sum phat if Minority==0 & dec2==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |        600    .3376711    .0911098   .1804695         .5

. loc p02 `r(mean)'

. 
. di "Relative Risk P(Minority=1|Dec=2]/P(Minority=0|Dec=2] " `p12'/`p02' 
Relative Risk P(Minority=1|Dec=2]/P(Minority=0|Dec=2] .67864963

. 
. 
. sum phat if Minority==1 & dec3==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      2,228    .2635614    .0781149   .1345353    .413802

. loc p13 `r(mean)'

. sum phat if Minority==0 & dec3==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      1,114    .3348761    .0888809   .1804695         .5

. loc p03 `r(mean)'

. 
. di `p13'/`p03'
.7870416

. di "Relative Risk P(Minority=1|Dec=3]/P(Minority=0|Dec=3] " `p13'/`p03'
Relative Risk P(Minority=1|Dec=3]/P(Minority=0|Dec=3] .7870416

. 
. sum phat if Minority==1 & dec4==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      1,054    .3650259    .0942332   .2026649   .5358008

. loc p14 `r(mean)'

. sum phat if Minority==0 & dec4==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |        527    .3299472    .0900188   .1804695         .5

. loc p04 `r(mean)'

. 
. di `p14'/`p04'
1.1063163

. di "Relative Risk P(Minority=1|Dec=4]/P(Minority=0|Dec=4] " `p14'/`p04'
Relative Risk P(Minority=1|Dec=4]/P(Minority=0|Dec=4] 1.1063163

. *collapse (mean) phat (count) choice, by(Minority dec2 dec3 dec4)
. 
. 
. mat def M=J(3,1,.)

. mat rownames M = minority minority minority

. mat M[1,1]=`p12'/`p02' 

. mat M[2,1]=`p13'/`p03'

. mat M[3,1]=`p14'/`p04'

. 
. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. 
. clogit choice  Hispanic_dec2  Hispanic_dec3 Hispanic_dec4 ///
>                                         Black_dec2  Black_dec3 Black_dec4 i.g
> ender i.education_level i.order, group(Address)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -910.23067  
Iteration 1:   log likelihood = -899.77346  
Iteration 2:   log likelihood = -899.71428  
Iteration 3:   log likelihood = -899.71427  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                LR chi2(11)       =     200.05
                                                Prob > chi2       =     0.0000
Log likelihood = -899.71427                     Pseudo R2         =     0.1000

------------------------------------------------------------------------------
      choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_d~2 |  -.2521266   .1725462    -1.46   0.144    -.5903108    .0860577
Hispanic_d~3 |  -.0790205   .1213052    -0.65   0.515    -.3167744    .1587334
Hispanic_d~4 |   .2938816   .1702538     1.73   0.084    -.0398097    .6275729
  Black_dec2 |  -.8083192   .1773036    -4.56   0.000    -1.155828   -.4608105
  Black_dec3 |  -.6198705   .1226623    -5.05   0.000    -.8602841   -.3794569
  Black_dec4 |  -.0088093   .1691212    -0.05   0.958    -.3402807    .3226621
             |
      gender |
       male  |  -.3068188   .0859281    -3.57   0.000    -.4752348   -.1384029
             |
education_~l |
        low  |  -.2085472    .117038    -1.78   0.075    -.4379375    .0208432
     medium  |  -.3217568   .0992453    -3.24   0.001     -.516274   -.1272395
             |
       order |
          2  |  -.3274132   .0856168    -3.82   0.000    -.4952191   -.1596074
          3  |  -.9038518     .08733   -10.35   0.000    -1.075016    -.732688
------------------------------------------------------------------------------

. predict phat_h_b, pu0

. 
. sum phat_h_b if Hispanic==1 & dec2==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        600    .2705435     .081876   .1437417   .4373001

. loc p12_h `r(mean)'

. sum phat_h_b if Hispanic==0 & dec2==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        600    .3347696    .0913234   .1776388         .5

. loc p02_h `r(mean)'

. 
. di "Relative Risk P(Hispanic=1|Dec=2]/P(Hispanic=0|Dec=2] " `p12_h'/`p02_h' 
Relative Risk P(Hispanic=1|Dec=2]/P(Hispanic=0|Dec=2] .80814843

. 
. 
. sum phat_h_b if Hispanic==1 & dec3==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,114    .3155357    .0879579   .1663877   .4802552

. loc p13_h `r(mean)'

. sum phat_h_b if Hispanic==0 & dec3==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,114    .3316263    .0889996   .1776388         .5

. loc p03_h `r(mean)'

. 
. di `p13_h'/`p03_h'
.95147994

. di "Relative Risk P(Hispanic=1|Dec=3]/P(Hispanic=0|Dec=3] " `p13_h'/`p03_h'
Relative Risk P(Hispanic=1|Dec=3]/P(Hispanic=0|Dec=3] .95147994

. 
. sum phat_h_b if Hispanic==1 & dec4==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        527    .3927807    .0972185   .2246892   .5729461

. loc p14_h `r(mean)'

. sum phat_h_b if Hispanic==0 & dec4==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        527    .3269439    .0902511   .1776388         .5

. loc p04_h `r(mean)'

. 
. di `p14_h'/`p04_h'
1.2013704

. di "Relative Risk P(Hispanic=1|Dec=4]/P(Hispanic=0|Dec=4] " `p14_h'/`p04_h'
Relative Risk P(Hispanic=1|Dec=4]/P(Hispanic=0|Dec=4] 1.2013704

. 
. 
. mat def H=J(3,1,.)

. mat rownames H = hispanic hispanic hispanic

. mat H[1,1]=`p12_h'/`p02_h' 

. mat H[2,1]=`p13_h'/`p03_h'

. mat H[3,1]=`p14_h'/`p04_h'

. 
. 
. 
. *Af American
. 
. sum phat_h_b if Black==1 & dec2==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        600    .1853699    .0595963   .0878041   .3082488

. loc p12_b `r(mean)'

. sum phat_h_b if Black==0 & dec2==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        600    .3347696    .0913234   .1776388         .5

. loc p02_b `r(mean)'

. 
. di "Relative Risk P(Hispanic=1|Dec=2]/P(Hispanic=0|Dec=2] " `p12_b'/`p02_b' 
Relative Risk P(Hispanic=1|Dec=2]/P(Hispanic=0|Dec=2] .55372398

. 
. 
. sum phat_h_b if Black==1 & dec3==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,114    .2120245    .0677369   .1041167   .3498109

. loc p13_b `r(mean)'

. sum phat_h_b if Black==0 & dec3==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,114    .3316263    .0889996   .1776388         .5

. loc p03_b `r(mean)'

. 
. di `p13_b'/`p03_b'
.63934779

. di "Relative Risk P(Hispanic=1|Dec=3]/P(Hispanic=0|Dec=3] " `p13_b'/`p03_b'
Relative Risk P(Hispanic=1|Dec=3]/P(Hispanic=0|Dec=3] .63934779

. 
. sum phat_h_b if Black==1 & dec4==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        527    .3317936    .0911818   .1763556   .4977977

. loc p14_b `r(mean)'

. sum phat_h_b if Black==0 & dec4==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |        527    .3269439    .0902511   .1776388         .5

. loc p04_b `r(mean)'

. 
. di `p14_b'/`p04_b'
1.0148337

. di "Relative Risk P(Hispanic=1|Dec=4]/P(Hispanic=0|Dec=4] " `p14_b'/`p04_b'
Relative Risk P(Hispanic=1|Dec=4]/P(Hispanic=0|Dec=4] 1.0148337

. 
. 
. mat def A=J(3,1,.)

. mat rownames A = black black black

. mat A[1,1]=`p12_b'/`p02_b' 

. mat A[2,1]=`p13_b'/`p03_b'

. mat A[3,1]=`p14_b'/`p04_b'

. 
. 
. *Export
. 
. mat def Res=M\A\H

. mat list Res

Res[9,1]
                 c1
minority  .67864963
minority   .7870416
minority  1.1063163
   black  .55372398
   black  .63934779
   black  1.0148337
hispanic  .80814843
hispanic  .95147994
hispanic  1.2013704

. 
. preserve

. clear

. svmat2 Res,  names(col)  rnames(race)
number of observations will be reset to 9
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 9

. gen n=_n

. 
. save "../stores/aux/rel_risk_quartile.dta"  , replace
(note: file ../stores/aux/rel_risk_quartile.dta not found)
file ../stores/aux/rel_risk_quartile.dta saved

. restore

. 
. 
. *****************************************************************************
> *******************
. *****************************************************************************
> *******************
. * Distance Minority_within1  Minority_more1
. *****************************************************************************
> *******************
. *****************************************************************************
> *******************
. 
. 
. drop phat phat_h_b

. clogit choice Minority_within1  Minority_more1 i.gender i.education_level i.o
> rder, group(Address)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -927.96374  
Iteration 1:   log likelihood = -920.17814  
Iteration 2:   log likelihood = -920.15913  
Iteration 3:   log likelihood = -920.15913  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                LR chi2(7)        =     159.16
                                                Prob > chi2       =     0.0000
Log likelihood = -920.15913                     Pseudo R2         =     0.0796

------------------------------------------------------------------------------
      choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_w~1 |  -.1191289   .1036863    -1.15   0.251    -.3223504    .0840926
Minority_m~1 |  -.4127944   .1050872    -3.93   0.000    -.6187616   -.2068273
             |
      gender |
       male  |  -.3208997   .0848199    -3.78   0.000    -.4871436   -.1546559
             |
education_~l |
        low  |  -.1822504   .1152522    -1.58   0.114    -.4081406    .0436398
     medium  |  -.2959499    .097845    -3.02   0.002    -.4877225   -.1041773
             |
       order |
          2  |   -.343484   .0843761    -4.07   0.000    -.5088581   -.1781099
          3  |  -.9051545   .0861823   -10.50   0.000    -1.074069   -.7362403
------------------------------------------------------------------------------

. predict phat, pu0

. 
. sum phat if Minority==1 & within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      2,168    .3058588    .0861873    .162311    .470253

. loc p12 `r(mean)'

. sum phat if Minority==0 & within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      1,084    .3321817    .0899689   .1791666         .5

. loc p02 `r(mean)'

. 
. 
. 
. sum phat if Minority==1 & more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      2,314    .2485848    .0758423   .1262204   .3982423

. loc p13 `r(mean)'

. sum phat if Minority==0 & more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
        phat |      1,157    .3322299    .0900775   .1791666         .5

. loc p03 `r(mean)'

. 
. 
. mat def M=J(2,1,.)

. mat rownames M = minority minority 

. mat M[1,1]=`p12'/`p02' 

. mat M[2,1]=`p13'/`p03'

. 
. 
. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. 
. clogit choice  Hispanic_within1  Hispanic_more1  ///
>                                         Black_within1  Black_more1  i.gender 
> i.education_level i.order, group(Address)
note: multiple positive outcomes within groups encountered.
note: 1,331 groups (3,993 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -912.97182  
Iteration 1:   log likelihood = -904.06377  
Iteration 2:   log likelihood = -904.01323  
Iteration 3:   log likelihood = -904.01323  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      2,730
                                                LR chi2(9)        =     191.45
                                                Prob > chi2       =     0.0000
Log likelihood = -904.01323                     Pseudo R2         =     0.0957

------------------------------------------------------------------------------
      choice |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   .1408006    .121584     1.16   0.247    -.0974996    .3791008
Hispanic_m~1 |  -.1898481   .1204729    -1.58   0.115    -.4259706    .0462744
Black_with~1 |  -.3696098   .1202418    -3.07   0.002    -.6052795   -.1339402
 Black_more1 |    -.65107   .1236481    -5.27   0.000    -.8934159   -.4087242
             |
      gender |
       male  |  -.3127156   .0856976    -3.65   0.000    -.4806797   -.1447514
             |
education_~l |
        low  |  -.2227868   .1168593    -1.91   0.057    -.4518269    .0062533
     medium  |  -.3160507   .0989291    -3.19   0.001    -.5099482   -.1221531
             |
       order |
          2  |  -.3392887   .0854569    -3.97   0.000    -.5067813   -.1717962
          3  |  -.9105731   .0872028   -10.44   0.000    -1.081488   -.7396587
------------------------------------------------------------------------------

. predict phat_h_b, pu0

. 
. sum phat_h_b if Hispanic==1 & within1==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,084    .3593134    .0944833   .1980481   .5351421

. loc p12_h `r(mean)'

. sum phat_h_b if Hispanic==0 & within1==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,084    .3290806    .0901118   .1766313         .5

. loc p02_h `r(mean)'

. 
. 
. 
. sum phat_h_b if Hispanic==1 & more1==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,157     .284627    .0843887   .1506915     .45268

. loc p13_h `r(mean)'

. sum phat_h_b if Hispanic==0 & more1==1 & Black==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,157    .3291012     .090319   .1766313         .5

. loc p03_h `r(mean)'

. 
. 
. 
. 
. mat def H=J(2,1,.)

. mat rownames H = hispanic hispanic 

. mat H[1,1]=`p12_h'/`p02_h' 

. mat H[2,1]=`p13_h'/`p03_h'

. 
. 
. 
. 
. *Af American
. 
. sum phat_h_b if Black==1 & within1==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,084    .2533296    .0774967    .129099   .4086353

. loc p12_b `r(mean)'

. sum phat_h_b if Black==0 & within1==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,084    .3290806    .0901118   .1766313         .5

. loc p02_b `r(mean)'

. 
. 
. 
. 
. sum phat_h_b if Black==1 & more1==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,157    .2084604    .0666164    .100615   .3427484

. loc p13_b `r(mean)'

. sum phat_h_b if Black==0 & more1==1 & Hispanic==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    phat_h_b |      1,157    .3291012     .090319   .1766313         .5

. loc p03_b `r(mean)'

. 
. 
. 
. mat def A=J(2,1,.)

. mat rownames A = black black 

. mat A[1,1]=`p12_b'/`p02_b' 

. mat A[2,1]=`p13_b'/`p03_b'

. 
. 
. 
. *Export
. 
. mat def Res=M\A\H

. mat list Res

Res[6,1]
                 c1
minority  .92075768
minority  .74823137
   black  .76981001
   black  .63342353
hispanic  1.0918703
hispanic  .86486184

. 
. preserve

. clear

. svmat2 Res,  names(col)  rnames(race)
number of observations will be reset to 6
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 6

. gen n=_n

. 
. save "../stores/aux/rel_risk_distance.dta"  , replace
(note: file ../stores/aux/rel_risk_distance.dta not found)
file ../stores/aux/rel_risk_distance.dta saved

. restore

. *end
. 
. 
end of do-file
